Function Reference

_ArrayDelete

Deletes the specified element from the given array, returning the adjusted array.

#include <Array.au3>
_ArrayDelete ( $avArray, $iElement )

 

Parameters

$avArray The array from which an element is to be deleted.
$iElement The index of the element to be deleted.

 

Return Value

Success: Returns 1 and the modified array is stored in the original Array.
Failure: Returns 0 and the original Array.
@Error: 0 = No error.
1 = $avArray isn't an array.
2 = $avArray has only 1 element in it.

 

Remarks

If the array passed in has only 1 element, this function returns an empty string.
If the modified array equals the original array, then the original array is returned and @error is set to 2.

 

Related

_ArrayAdd, _ArrayInsert

 

Example


#include <Array.au3>

Dim $avArray[10]
$avArray[0] = "JPM"
$avArray[1] = "Holger"
$avArray[2] = "Jon"
$avArray[3] = "Larry"
$avArray[4] = "Jeremy"
$avArray[5] = "Valik"
$avArray[6] = "Cyberslug"
$avArray[7] = "Nutster"
$avArray[8] = "JdeB"
$avArray[9] = "Tylo"
_ArrayDisplay( $avArray, "Whole array" )
_ArrayDelete( $avArray,8)
_ArrayDisplay( $avArray, "Removed entry 8" )